package easybooking.report;

import java.io.Serializable;
import java.util.Vector;

/**
 * Row of a <code>SimpleReport</code>-objects table. <code>Row</code>-objects
 * implement the <code>Serializable</code>-Interface, thus they can transferred from the server to the client
 * as copy.
 *
 * @see SimpleReport
 * @see Column
 * @author Hakan Keles
 */
public class Row implements Serializable {

    /**
     * Storage for the columns of a row.
     */
    private Vector<Column> columns = new Vector<Column>();

    /**
     * Add a columns.
     *
     * @param c the column-object
     */
    public void addColumn(Column c) {
        this.columns.addElement(c);
    }

    /**
     * Remove a column with content.
     * @param c the column-object, which will be removed.
     */
    public void removeColumn(Column c) {
        this.columns.removeElement(c);
    }

    /**
     * Read-out all columns.
     *
     * @return <code>Vector</code>-objects with all columns.
     */
    public Vector<Column> getColumns() {
        return this.columns;
    }

    /**
     * Read-out the number of columns.
     * @return int Number of columns.
     */
    public int getNumColumns() {
        return this.columns.size();
    }

    /**
     * Read-out a single column-object.
     * @param i Index of the columns, which will be readen out. (0 <= i < n), n = Number
     * of columns.
     * @return the desired column-objects
     */
    public Column getColumnAt(int i) {
        return this.columns.elementAt(i);
    }
}



